package cn.rslee.scala.spark.demos

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

object MapTest {
  def main(args: Array[String]): Unit =
    {
      println("开始运行MapTest")
      val sc = new SparkContext(new SparkConf().setAppName("MapTest").setMaster("local"))
    
      val data = sc.parallelize(1 to 10,1);
      data.foreach((x:Int)=>print(x+" "))
      val result = data.map(it=>it*10);
      var result2 = result.collect();
      var result3 = result2.filter(it=>it/80==1);
      result3.foreach((x:Int)=>print(x+" "))
    }
}